<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  
    <base href="<%=basePath%>">
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	
	<link href="${pageContext.request.contextPath}/assets/css/bootstrap.min.css" rel="stylesheet" />
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css"/>       
	<link href="${pageContext.request.contextPath}/assets/css/codemirror.css" rel="stylesheet">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/ace.min.css" />
	<link rel="stylesheet" href="${pageContext.request.contextPath}/font/css/font-awesome.min.css" />
	<!--[if lte IE 8]>
	  <link rel="stylesheet" href="assets/css/ace-ie.min.css" />
	<![endif]-->
	<script src="${pageContext.request.contextPath}/js/jquery-1.9.1.min.js"></script>
	<script src="${pageContext.request.contextPath}/assets/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/H-ui.js"></script>     
	<script src="${pageContext.request.contextPath}/assets/js/typeahead-bs2.min.js"></script>           	
	<script src="${pageContext.request.contextPath}/assets/js/jquery.dataTables.min.js"></script>
	<script src="${pageContext.request.contextPath}/assets/js/jquery.dataTables.bootstrap.js"></script>
	<script src="${pageContext.request.contextPath}/assets/layer/layer.js" type="text/javascript" ></script>          
	<script src="${pageContext.request.contextPath}/assets/laydate/laydate.js" type="text/javascript"></script>
	<script src="${pageContext.request.contextPath}/assets/js/jquery.easy-pie-chart.min.js"></script>
	<script src="${pageContext.request.contextPath}/js/lrtk.js" type="text/javascript" ></script>
	
	<title>拍卖场</title>
  </head>

<body>
	<div class="margin clearfix">
		<div class="Order_form clearfix" id="Order_form_style">
		</div>

		<!--订单表格-->
		<div class="order_list" id="order_list">
  			<div class="h_products_list clearfix" id="products_list">
       			<div id="scrollsidebar" class="left_Treeview">
        			<div class="show_btn" id="rightArrow"><span></span></div>
        			<div class="widget-box side_content" >
         				<div class="side_title"><a title="隐藏" class="close_btn"><span></span></a></div>
         				<div class="side_list">
         					<div class="widget-header header-color-green2"><h4 class="lighter smaller">商品类型分类</h4></div>
        					<div class="widget-body">         
						        <ul class="b_P_Sort_list">
						             <c:if test="${lgt!=null && lgt.size()>0}">
						             	<c:set var="fst" value="0"></c:set>
						             	<c:forEach items="${lgt}" var="t2">
						             		<c:if test="${t2.good_level==1}">
						             			<c:set var="fstc" value="${fst+1}"></c:set>
						             			<c:set var="fst" value="${fstc}"></c:set>
						             		</c:if>
						             	</c:forEach>
						             	<li><i class="orange  fa fa-reorder"></i><a href="#">全部分类（${fst}）</a></li>
						             	<c:forEach items="${lgt}" var="t" varStatus="ss">
						             		<li>
						             			<c:if test="${t.good_level==1}">
							             			<i class="fa fa-sticky-note
								             			<c:choose>
									             			<c:when test="${ss.count%10==1}">blue</c:when>
									             			<c:when test="${ss.count%2==1}">pink</c:when>
									             			<c:when test="${ss.count%3==1}">yellow</c:when>
									             			<c:when test="${ss.count%4==1}">green</c:when>
									             			<c:when  test="${ss.count%5==1}">red</c:when>
								             			</c:choose>">
							             			</i>
							             			<a href="javascript:;">${t.name}</a>
						             			</c:if>
						             		</li>
						             	</c:forEach>
						             </c:if>
						        </ul>
       						</div>
       					</div>
      				</div>  
     			</div>
     			<!--订单列表-->
     			<div class="table_menu_list order_style" id="table_order_list">
       				<div class="search_style">
       					<form id="form1" action="${pageContext.request.contextPath}/auctionMsgServlet" method="post">
						<div class="title_names">搜索查询</div>
							<ul class="search_content clearfix">
								<li><label class="l_f">拍卖场编号AM</label><input name="auctionMsg_id" type="text" class="text_add" placeholder="拍卖记录编号AM" style=" width:250px"></li>
								<li><label class="l_f">时间</label><input class="inline laydate-icon" id="start" name="start_date" style=" margin-left:10px;"></li>
								<li style="width:90px;"><button type="button" class="btn_search" id="queryByCDT"><i class="fa fa-search"></i>查询</button></li>
							</ul>
							<input type="hidden" name="opr">
						</form>
    				</div>
     			<!--订单列表展示-->
				<table class="table table-striped table-bordered table-hover" id="sample-table">
					<thead>
						<tr>
							<th width="25px"><label><input type="checkbox" class="ace"><span class="lbl"></span></label></th>
							<th width="80px">拍卖场编号</th>
							<th width="100px">拍卖品编号</th>
							<th width="250px">拍卖品名称</th>
							<th width="60px">卖家编号</th>
							<th width="100px">所属类型</th>
			                <th width="80px">数量</th>
							<th width="100px">起拍价</th>
							<th width="100px">出价幅度</th>
							<th width="100px">直购价</th>
			                <th width="100px">开拍时间</th>
			                <th width="100px">拍卖时长</th>
			                <th width="100px">结束时间</th>
							<th width="70px">竞拍状态</th>                
							<th width="130px">记录</th>
						</tr>
					</thead>
					<tbody>
						<c:if test="${lam!=null &&lam.size()>0}">
							<c:forEach items="${lam}" var="am">
								<tr>
									<td><label><input type="checkbox" class="ace"><span class="lbl"></span></label></td>
									<td>AM${am.auctionMsg_id}</td>
									<!-- <td class="order_product_name">
										<a href="#"><img src="products/p_1.jpg"  title="商品名称"/></a>
										<i class="fa fa-plus"></i>
										<a href="#"><img src="products/p_2.jpg"  title="商品名称"/></a>
									</td> -->
								 	<td>G${am.goods_id}</td>
								 	<td>
								 		<c:if test="${lg!=null && lg.size()>0}">
								 			<c:forEach items="${lg}" var="g">
								 				<c:if test="${g.goods_id==am.goods_id}">
								 					${g.goods_name}
								 				</c:if>
								 			</c:forEach>
								 		</c:if>
								 	</td>
								    <td>C${am.customer_id}</td>
								 	<td>
									 	<c:if test="${lg!=null && lg.size()>0 && lgt!=null && lgt.size()>0}">
									 		<c:forEach items="${lg}" var="g2">
									 			<c:forEach items="${lgt}" var="gt1">
									 				<c:if test="${gt1.goodsType_id==g2.goodsType_id && g2.goods_id==am.goods_id}">
									 					${gt1.name}
									 				</c:if>
									 			</c:forEach>
									 		</c:forEach>
									 	</c:if>
									 </td>
								    <td>1</td>
								    <td>
								 		<c:if test="${lg!=null && lg.size()>0}">
								 			<c:forEach items="${lg}" var="g3">
								 				<c:if test="${g3.goods_id==am.goods_id}">
								 					${g3.minPrice}
								 				</c:if>
								 			</c:forEach>
								 		</c:if>
								 	</td>
								    <td>
								    	<c:if test="${lm!=null && lm.size()>0}">
								 			<c:forEach items="${lm}" var="mp">
								 				<c:if test="${mp.markup_id==am.markup_id}">
								 					${mp.markup_money}
								 				</c:if>
								 			</c:forEach>
								 		</c:if>
								    </td>
								    <td>
								 		<c:if test="${lg!=null && lg.size()>0}">
								 			<c:forEach items="${lg}" var="g4">
								 				<c:if test="${g4.goods_id==am.goods_id}">
								 					${g4.buyoutPrice}
								 				</c:if>
								 			</c:forEach>
								 		</c:if>
								 	</td>
								    <td>${am.start_date}</td>
								    <td>
								    	<c:if test="${ltr!=null && ltr.size()>0}">
								 			<c:forEach items="${ltr}" var="tr1">
								 				<c:if test="${tr1.timeRules_id==am.timeRules_id}">
								 					${tr1.timeLimit}分钟
								 				</c:if>
								 			</c:forEach>
								 		</c:if>
								    </td>
								    <td>${am.end_date}</td>
								    <td>
								    	<c:if test="${lgs!=null && lgs.size()>0}">
								 			<c:forEach items="${lgs}" var="gs">
								 				<c:if test="${gs.goodsState_id==am.goodsState_id}">
								 					<span class="label
									 					<c:if test="${am.goodsState_id==0}">label-default</c:if>
									 					<c:if test="${am.goodsState_id==1}">label-success</c:if>
									 					<c:if test="${am.goodsState_id==2}">label-info</c:if>
								 					radius">${gs.goodsState_name}</span>
								 				</c:if>
								 			</c:forEach>
								 		</c:if>
								    </td>
								    <td>
								    	<a title="出价记录" href="${pageContext.request.contextPath}/recordServlet?opr=alist&auctionMsg_id=${am.auctionMsg_id}"  class="btn btn-xs btn-info order_detailed" ><i class="fa fa-list bigger-120"></i></a>
								    </td>
							    </tr>
							</c:forEach>
						</c:if>
     
					</tbody>
     			</table>
			</div>
		</div>
	</div>
		<script type="text/javascript">
		//左侧显示隐藏
		$(function() { 
			$("#order_list").fix({
				float : 'left',
				//minStatue : true,
				skin : 'green',	
				durationTime :false,
				spacingw:50,//设置隐藏时的距离
			    spacingh:270,//设置显示时间距
				close_btn:'.close_btn',
				show_btn:'.show_btn',
				side_list:'.side_list',
			});
		});
		//顶部隐藏显示
		$(function() { 
			$("#Order_form_style").fix({
				float : 'top',
				//minStatue : true,
				skin : 'green',	
				durationTime :true,
				spacingw:0,
				spacingh:0,
				close_btn:'.top_close_btn',
				show_btn:'.top_show_btn',
				side_list:'.hide_style',
				close_btn_width:80,
				side_title:'.Statistic_title',
			});
		});
		//时间选择
		 laydate({
		    elem: '#start',
		    event: 'focus' 
		});
		/*订单-删除*/
		function Order_form_del(obj,id){
			layer.confirm('确认要删除吗？',function(index){
				$(obj).parents("tr").remove();
				layer.msg('已删除!',{icon:1,time:1000});
			});
		}
		/**发货**/
		function Delivery_stop(obj,id){
			layer.open({
		        type: 1,
		        title: '发货',
				maxmin: true, 
				shadeClose:false,
		        area : ['500px' , ''],
		        content:$('#Delivery_stop'),
				btn:['确定','取消'],
				yes: function(index, layero){		
				if($('#form-field-1').val()==""){
					layer.alert('快递号不能为空！',{
		               title: '提示框',				
					  icon:0,		
					  });
					
					}else{			
					 layer.confirm('提交成功！',function(index){
				$(obj).parents("tr").find(".td-manage").prepend('<a style=" display:none" class="btn btn-xs btn-success" onClick="member_stop(this,id)" href="javascript:;" title="已发货"><i class="fa fa-cubes bigger-120"></i></a>');
				$(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已发货</span>');
				$(obj).remove();
				layer.msg('已发货!',{icon: 6,time:1000});
					});  
					layer.close(index);    		  
				  }
				
				}
			});
		};
		//面包屑返回值
		var index = parent.layer.getFrameIndex(window.name);
		parent.layer.iframeAuto(index);
		$('.Order_form,.order_detailed').on('click', function(){
			var cname = $(this).attr("title");
			var chref = $(this).attr("href");
			var cnames = parent.$('.Current_page').html();
			var herf = parent.$("#iframe").attr("src");
		    parent.$('#parentIframe').html(cname);
		    parent.$('#iframe').attr("src",chref).ready();;
			parent.$('#parentIframe').css("display","inline-block");
			parent.$('.Current_page').attr({"name":herf,"href":"javascript:void(0)"}).css({"color":"#4c8fbd","cursor":"pointer"});
			//parent.$('.Current_page').html("<a href='javascript:void(0)' name="+herf+" class='iframeurl'>" + cnames + "</a>");
		    parent.layer.close(index);
			
		});
		
		//初始化宽度、高度
		$(".hide_style").height($(".hide_style").height()); 
		 var heights=$(".hide_style").outerHeight(true)+90;  
		 $(".widget-box").height($(window).height()-heights); 
		$(".table_menu_list").width($(window).width()-250);
		 $(".table_menu_list").height($(window).height()-heights);
		  //当文档窗口发生改变时 触发  
		    $(window).resize(function(){
			$(".widget-box").height($(window).height()-heights);
			 $(".table_menu_list").width($(window).width()-250);
			  $(".table_menu_list").height($(window).height()-heights);
			});
		//比例
		var oldie = /msie\s*(8|7|6)/.test(navigator.userAgent.toLowerCase());
					$('.easy-pie-chart.percentage').each(function(){
						$(this).easyPieChart({
							barColor: $(this).data('color'),
							trackColor: '#EEEEEE',
							scaleColor: false,
							lineCap: 'butt',
							lineWidth: 10,
							animate: oldie ? false : 1000,
							size:103
						}).css('color', $(this).data('color'));
					});
				
					$('[data-rel=tooltip]').tooltip();
					$('[data-rel=popover]').popover({html:true});
		</script>
		<script type="text/javascript">
		//订单列表
		jQuery(function($) {
				var oTable1 = $('#sample-table').dataTable( {
				"aaSorting": [[ 1, "desc" ]],//默认第几个排序
				"bStateSave": true,//状态保存
				"aoColumnDefs": [
				  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
				  {"orderable":false,"aTargets":[0,1,2,3,4,5,6,7,8,9]}// 制定列不参与排序
				] } );
						$('table th input:checkbox').on('click' , function(){
							var that = this;
							$(this).closest('table').find('tr > td:first-child input:checkbox')
							.each(function(){
								this.checked = that.checked;
								$(this).closest('tr').toggleClass('selected');
							});
								
						});
					
					
						$('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});
						function tooltip_placement(context, source) {
							var $source = $(source);
							var $parent = $source.closest('table');
							var off1 = $parent.offset();
							var w1 = $parent.width();
					
							var off2 = $source.offset();
							var w2 = $source.width();
					
							if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
							return 'left';
						}
					});
			$("#queryByCDT").click(function(){
				if(($("[name='auctionMsg_id']").val().length>0)&&($("[name='start_date']").val().length>0))
					$("[name='opr']").val("id&date");
				else if($("[name='auctionMsg_id']").val().length>0)
					$("[name='opr']").val("byid");
				else if($("[name='start_date']").val().length>0){
					$("[name='opr']").val("bydate");
				}
				$("#form1").submit();
			});
		</script>
	</body>
</html>